-- GENERATED SPELL FOR [Haunting Vision] --


function spell0_4472(pUnit, Event) --@Altered Cauldron Toxin,n/a--
pUnit:FullCastSpellOnTarget(17650,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4472', 623, 1)
end

function spell1_4472(pUnit, Event) --@Cripple,n/a--
pUnit:FullCastSpellOnTarget(11443,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4472', 18000, 1)
end

function spell2_4472(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(11981,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4472', 3000, 1)
end

function spell3_4472(pUnit, Event) --@Mind Blast,n/a--
pUnit:FullCastSpellOnTarget(13860,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4472', 1500, 1)
end

function Sorts_4472(pUnit, Event)
local choix_sorts_4472 = math.random(0, 3)
if choix_sorts_4472 == 0 then
pUnit:RegisterEvent('spell0_4472', 1, 1)
end
if choix_sorts_4472 == 1 then
pUnit:RegisterEvent('spell1_4472', 1, 1)
end
if choix_sorts_4472 == 2 then
pUnit:RegisterEvent('spell2_4472', 1, 1)
end
if choix_sorts_4472 == 3 then
pUnit:RegisterEvent('spell3_4472', 1, 1)
end
end

function mob4472_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4472', math.random(1500, 3000), 1)
end

function mob4472_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4472_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4472_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4472, 1, 'mob4472_Action')
RegisterUnitEvent(4472, 2, 'mob4472_Leave')
RegisterUnitEvent(4472, 3, 'mob4472_Kill')
RegisterUnitEvent(4472, 4, 'mob4472_Die')
